package com.linxin.mapper;

import com.linxin.entity.Menu;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 * 后台菜单 Mapper 接口
 * </p>
 *
 * @author linxin
 * @since 2022-05-04
 */
public interface MenuMapper extends BaseMapper<Menu> {
    //根据角色获取菜单列表
//    @Select("select m.*,r.id as rid,r.name as rname,r.zhName as rzhName from menu as m,role as r,menu_role as mr where m.id=mr.menu_id and r.id=mr.role_id order by m.id")
    List<Menu> getMenusWithRole();
    //根据用户id 获取对应菜单
    List<Menu> getMenusByAdminId(Integer id);


}
